<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2020/3/1
 * Time: 16:51
 */

namespace app\api\validate;

use think\Validate;

class User extends Validate
{
    protected $rule = [
        'phone|电话号码'=>'require|length:11',
        'code|验证码'=>'require|max:10',
        'password|密码'=>'require',
        'repassword|确认密码'=>'require|confirm:password'
    ];

    /**
     * 注册验证
     */
    public function sceneRegister()
    {
        return $this->only(['phone','code','repassword','password']);
    }

    /**
     * 手机登录
     */
    public function sceneLogin()
    {
        return $this->only(['phone','password']);
    }
}